/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author HoangHai
 */
@Entity
@Table(name = "Mark", catalog = "DeclarationBoardProject", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Mark.findAll", query = "SELECT m FROM Mark m"),
    @NamedQuery(name = "Mark.findByMarkID", query = "SELECT m FROM Mark m WHERE m.markID = :markID"),
    @NamedQuery(name = "Mark.findByMark", query = "SELECT m FROM Mark m WHERE m.mark = :mark"),
    @NamedQuery(name = "Mark.findByStatus", query = "SELECT m FROM Mark m WHERE m.status = :status")})
public class Mark implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "MarkID", nullable = false)
    private Integer markID;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "Mark", precision = 53)
    private Double mark;
    @Column(name = "Status")
    private Integer status;
    @JoinColumn(name = "SubID", referencedColumnName = "SubID", nullable = false)
    @ManyToOne(optional = false)
    private Subject subID;
    @JoinColumn(name = "StuID", referencedColumnName = "StuID", nullable = false)
    @ManyToOne(optional = false)
    private Student stuID;

    public Mark() {
    }

    public Mark(Integer markID) {
        this.markID = markID;
    }

    public Integer getMarkID() {
        return markID;
    }

    public void setMarkID(Integer markID) {
        this.markID = markID;
    }

    public Double getMark() {
        return mark;
    }

    public void setMark(Double mark) {
        this.mark = mark;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Subject getSubID() {
        return subID;
    }

    public void setSubID(Subject subID) {
        this.subID = subID;
    }

    public Student getStuID() {
        return stuID;
    }

    public void setStuID(Student stuID) {
        this.stuID = stuID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (markID != null ? markID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Mark)) {
            return false;
        }
        Mark other = (Mark) object;
        if ((this.markID == null && other.markID != null) || (this.markID != null && !this.markID.equals(other.markID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Mark[ markID=" + markID + " ]";
    }
    
}
